<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <input type="text" id="ipt" oninput="iptEv()">
        <p id="p"></p>
    </div>
    
    <script>
        const p = document.getElementById('p')
        const ipt = document.getElementById('ipt')
        var obj = {
            name: '张三',
            age: 15,
            tel: 110
        }
        p.innerText = obj.tel
        ipt.value = obj.tel
        var $obj = Object.assign({}, obj)
        Object.defineProperty(obj, 'tel', {
            set(val) {
                $obj.tel = val
                p.innerText = val
            },
            get() {
                return $obj.tel
            }
        })

        function iptEv(e) {
            let event = e || window.event
            obj.tel = event.target.value
            console.log(obj)
        }

    </script>
</body>
</html>